3.2.13 \(\int \frac {c+d x}{a+a \cosh (e+f x)} \, dx\) [113]

Optimal. Leaf size=49 \[ -\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f} \]

[Out]

-2*d*ln(cosh(1/2*f*x+1/2*e))/a/f^2+(d*x+c)*tanh(1/2*f*x+1/2*e)/a/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3399, 4269, 3556} \begin {gather*} \frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)/(a + a*Cosh[e + f*x]),x]

[Out]

(-2*d*Log[Cosh[e/2 + (f*x)/2]])/(a*f^2) + ((c + d*x)*Tanh[e/2 + (f*x)/2])/(a*f)

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {c+d x}{a+a \cosh (e+f x)} \, dx &=\frac {\int (c+d x) \csc ^2\left (\frac {1}{2} (i e+\pi )+\frac {i f x}{2}\right ) \, dx}{2 a}\\ &=\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {d \int \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a f}\\ &=-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.16, size = 70, normalized size = 1.43 \begin {gather*} \frac {2 \cosh \left (\frac {1}{2} (e+f x)\right ) \left (-2 d \cosh \left (\frac {1}{2} (e+f x)\right ) \log \left (\cosh \left (\frac {1}{2} (e+f x)\right )\right )+f (c+d x) \sinh \left (\frac {1}{2} (e+f x)\right )\right )}{a f^2 (1+\cosh (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)/(a + a*Cosh[e + f*x]),x]

[Out]

(2*Cosh[(e + f*x)/2]*(-2*d*Cosh[(e + f*x)/2]*Log[Cosh[(e + f*x)/2]] + f*(c + d*x)*Sinh[(e + f*x)/2]))/(a*f^2*(
1 + Cosh[e + f*x]))

________________________________________________________________________________________

Maple [A]
time = 1.23, size = 63, normalized size = 1.29

method result size
risch \(\frac {2 d x}{a f}+\frac {2 d e}{a \,f^{2}}-\frac {2 \left (d x +c \right )}{a f \left ({\mathrm e}^{f x +e}+1\right )}-\frac {2 d \ln \left ({\mathrm e}^{f x +e}+1\right )}{a \,f^{2}}\) \(63\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a+a*cosh(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2*d/a/f*x+2*d/a/f^2*e-2*(d*x+c)/a/f/(exp(f*x+e)+1)-2*d/a/f^2*ln(exp(f*x+e)+1)

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 76, normalized size = 1.55 \begin {gather*} 2 \, d {\left (\frac {x e^{\left (f x + e\right )}}{a f e^{\left (f x + e\right )} + a f} - \frac {\log \left ({\left (e^{\left (f x + e\right )} + 1\right )} e^{\left (-e\right )}\right )}{a f^{2}}\right )} + \frac {2 \, c}{{\left (a e^{\left (-f x - e\right )} + a\right )} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="maxima")

[Out]

2*d*(x*e^(f*x + e)/(a*f*e^(f*x + e) + a*f) - log((e^(f*x + e) + 1)*e^(-e))/(a*f^2)) + 2*c/((a*e^(-f*x - e) + a
)*f)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 116 vs. \(2 (43) = 86\).
time = 0.41, size = 116, normalized size = 2.37 \begin {gather*} \frac {2 \, {\left (d f x \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + d f x \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) - c f - {\left (d \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + d \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + d\right )} \log \left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 1\right )\right )}}{a f^{2} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + a f^{2} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + a f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="fricas")

[Out]

2*(d*f*x*cosh(f*x + cosh(1) + sinh(1)) + d*f*x*sinh(f*x + cosh(1) + sinh(1)) - c*f - (d*cosh(f*x + cosh(1) + s
inh(1)) + d*sinh(f*x + cosh(1) + sinh(1)) + d)*log(cosh(f*x + cosh(1) + sinh(1)) + sinh(f*x + cosh(1) + sinh(1
)) + 1))/(a*f^2*cosh(f*x + cosh(1) + sinh(1)) + a*f^2*sinh(f*x + cosh(1) + sinh(1)) + a*f^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (37) = 74\).
time = 0.33, size = 76, normalized size = 1.55 \begin {gather*} \begin {cases} \frac {c \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f} + \frac {d x \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f} - \frac {d x}{a f} + \frac {2 d \log {\left (\tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 1 \right )}}{a f^{2}} & \text {for}\: f \neq 0 \\\frac {c x + \frac {d x^{2}}{2}}{a \cosh {\left (e \right )} + a} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x)

[Out]

Piecewise((c*tanh(e/2 + f*x/2)/(a*f) + d*x*tanh(e/2 + f*x/2)/(a*f) - d*x/(a*f) + 2*d*log(tanh(e/2 + f*x/2) + 1
)/(a*f**2), Ne(f, 0)), ((c*x + d*x**2/2)/(a*cosh(e) + a), True))

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 66, normalized size = 1.35 \begin {gather*} \frac {2 \, {\left (d f x e^{\left (f x + e\right )} - d e^{\left (f x + e\right )} \log \left (e^{\left (f x + e\right )} + 1\right ) - c f - d \log \left (e^{\left (f x + e\right )} + 1\right )\right )}}{a f^{2} e^{\left (f x + e\right )} + a f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e)),x, algorithm="giac")

[Out]

2*(d*f*x*e^(f*x + e) - d*e^(f*x + e)*log(e^(f*x + e) + 1) - c*f - d*log(e^(f*x + e) + 1))/(a*f^2*e^(f*x + e) +
 a*f^2)

________________________________________________________________________________________

Mupad [B]
time = 0.90, size = 53, normalized size = 1.08 \begin {gather*} \frac {2\,d\,x}{a\,f}-\frac {2\,\left (c+d\,x\right )}{a\,f\,\left ({\mathrm {e}}^{e+f\,x}+1\right )}-\frac {2\,d\,\ln \left ({\mathrm {e}}^{f\,x}\,{\mathrm {e}}^e+1\right )}{a\,f^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/(a + a*cosh(e + f*x)),x)

[Out]

(2*d*x)/(a*f) - (2*(c + d*x))/(a*f*(exp(e + f*x) + 1)) - (2*d*log(exp(f*x)*exp(e) + 1))/(a*f^2)

________________________________________________________________________________________